package com.ebid.templates.twenty;

import com.ebid.templates.utils.ParameterUtils;

import java.text.MessageFormat;

public class OpenBidRecord {

    private static String openBidRecord ="<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n"+
            "<openBidRecord> \n" +
            "    <openBidRecordCode>{0}</openBidRecordCode>\n" +
            "    <openBidRecordName>{1}</openBidRecordName>\n" +
            "    <tenderProjectCode>{2}</tenderProjectCode>\n" +
            "    <bidSectionCodes>{3}</bidSectionCodes>\n" +
            "    <unifiedDealCodes>{4}</unifiedDealCodes>\n" +
            "    <bidOpeningActor>{5}</bidOpeningActor>\n" +
            "    <bidOpenContent>{6}</bidOpenContent>\n" +
            "    <bidOpenAddress>{7}</bidOpenAddress>\n" +
            "    <bidOpenTime>{8}</bidOpenTime>\n" +
            "    <URL>{9}</URL>\n" +
            "    <examinerName>{10}</examinerName>\n" +
            "    <examinerCodeType>{11}</examinerCodeType>\n" +
            "    <examinerCode>{12}</examinerCode>\n" +
            "    <attachmentCode>{13}</attachmentCode>\n" +
            "    <version>{14}</version>\n" +
            "    <isOpen>{15}</isOpen>\n" +
            "    <openType>{16}</openType>\n" +
            "    <platFormCode>{17}</platFormCode>\n" +
            "    <pubServicePlatCode>{18}</pubServicePlatCode>\n" +
            "    <verifyTime>{19}</verifyTime>\n" +
            "</openBidRecord>";

    public static void setOpenBidRecord(String openBidRecord,String s0,String s1,String s2,String s3,String s4,String s5,String s6,String s7,String s8,String s9,String s10
            ,String s11,String s12,String s13,String s14,String s15,String s16,String s17,String s18,String s19) {
        OpenBidRecord.openBidRecord = MessageFormat.format(openBidRecord,s0,s1,s2,s3,s4,s5,s6,s7,s8,s9,s10,
                s11,s12,s13,s14,s15,s16,s17,s18,s19);
    }

    public static void setOpenBidRecord(){
        setOpenBidRecord(openBidRecord, ParameterUtils.get("openBidRecordCode"),
                                       ParameterUtils.get("openBidRecordName"),
                                       ParameterUtils.get("tenderProjectCode"),
                                       ParameterUtils.get("bidSectionCodes"),
                                       ParameterUtils.get("unifiedDealCodes"),
                                       ParameterUtils.get("bidOpeningActor"),
                                       ParameterUtils.get("bidOpenContent"),
                                       ParameterUtils.get("bidOpenAddress"),
                                       ParameterUtils.get("bidOpenTime"),
                                       ParameterUtils.get("URL"),
                                       ParameterUtils.get("examinerName"),
                                       ParameterUtils.get("examinerCodeType"),
                                       ParameterUtils.get("examinerCode"),
                                       ParameterUtils.get("attachmentCode"),
                                       ParameterUtils.get("version"),
                                       ParameterUtils.get("isOpen"),
                                       ParameterUtils.get("openType"),
                                       ParameterUtils.get("platFormCode"),
                                       ParameterUtils.get("pubServicePlatCode"),
                                       ParameterUtils.get("verifyTime")
                );
    }

    public static void main(String[] args) {

        setOpenBidRecord();
        System.out.println(openBidRecord);
    }
}
